package com.xqb.modules.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.sql.Time;
import java.util.Date;

/**
 * @author 赵鹏宇
 * @TableName exa_exam_detail
 */
@TableName(value = "exa_exam_detail")
@Data
public class ExaExamDetail implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 考试测验详情id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 题目类型，用,隔开
     */
    private String questionInfo;
    /**
     * 分数
     */
    private Integer score;
    /**
     * 考试时间
     */
    private Time needTime;
    /**
     * 开始时间
     */
    private Date stardTime;
    /**
     * 结束时间
     */
    private Date endTime;
    /**
     * 目录id
     */
    private Long courseCatalogueId;
    /**
     * 题目数量
     */
    private Integer questionNum;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ExaExamDetail other = (ExaExamDetail) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getQuestionInfo() == null ? other.getQuestionInfo() == null : this.getQuestionInfo().equals(other.getQuestionInfo()))
                && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
                && (this.getNeedTime() == null ? other.getNeedTime() == null : this.getNeedTime().equals(other.getNeedTime()))
                && (this.getStardTime() == null ? other.getStardTime() == null : this.getStardTime().equals(other.getStardTime()))
                && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime()))
                && (this.getCourseCatalogueId() == null ? other.getCourseCatalogueId() == null : this.getCourseCatalogueId().equals(other.getCourseCatalogueId()))
                && (this.getQuestionNum() == null ? other.getQuestionNum() == null : this.getQuestionNum().equals(other.getQuestionNum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getQuestionInfo() == null) ? 0 : getQuestionInfo().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        result = prime * result + ((getNeedTime() == null) ? 0 : getNeedTime().hashCode());
        result = prime * result + ((getStardTime() == null) ? 0 : getStardTime().hashCode());
        result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
        result = prime * result + ((getCourseCatalogueId() == null) ? 0 : getCourseCatalogueId().hashCode());
        result = prime * result + ((getQuestionNum() == null) ? 0 : getQuestionNum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", questionInfo=").append(questionInfo);
        sb.append(", score=").append(score);
        sb.append(", needTime=").append(needTime);
        sb.append(", stardTime=").append(stardTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", courseCatalogueId=").append(courseCatalogueId);
        sb.append(", questionNum=").append(questionNum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}